package com.gregbugaj.gps;

public enum Direction {
	NORTH("N"),
	SOUTH("S"),
	WEST("W"),
	EAST("E");

	private final String value;
	private Direction(String value){
		this.value=value;
	}

	public String getValue(){

		return this.value;
	}

	public static Direction fromValue(String value) {
		for(Direction d:Direction.values()){
			if(d.getValue().equals(value)){
				return d;
			}
		}
		throw new IllegalArgumentException(value);
	}
}
